package com.zx.flow.api.config;

import com.google.common.collect.Lists;
import com.zx.flow.api.config.FlowConfigCheckChain.Check1;
import com.zx.flow.api.config.FlowConfigCheckChain.Check2;
import com.zx.flow.api.config.FlowConfigCheckChain.Check3;
import java.util.List;

public class FlowConfigCheckHandler {

    private static List<FlowConfigCheckChain> CHECK_CHAIN;

    public static void init() {
        CHECK_CHAIN = Lists.newArrayList(
                new Check1(),
                new Check2(),
                new Check3()
        );
    }

    public static void check(FlowConfig flowConfig) {
        for (FlowConfigCheckChain chain : CHECK_CHAIN) {
            chain.check(flowConfig);
        }
    }

}
